<?php

$dir    = dirname(__FILE__);
$scheme = (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on')? 'https': 'http';
$path   = pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME);

/* PHP configurations */
ini_set('include_path',                 "$dir/lib/PEAR" . PATH_SEPARATOR . "$dir/lib" . PATH_SEPARATOR . ini_get('include_path'));
ini_set('session.name',                 'mobileproxy');
ini_set('session.use_cookies',          1);
ini_set('session.use_only_cookies',     1);
ini_set('session.use_trans_sid',        0);
ini_set('session.cache_limiter',        'nocache');
ini_set('mbstring.detect_order',        'ASCII, JIS, UTF-8, EUCJP-WIN, SJIS-WIN');
ini_set('mbstring.http_input',          'pass');
ini_set('mbstring.http_output',         'pass');
ini_set('mbstring.internal_encoding',   'UTF-8');

/* The path of the YAML file which defines the default request headers value */
define('MOBILEPROXY_REQUESTHEADERS_YAML',   "$dir/request-headers.yaml");

/* The path of Jsphon library */
define('MOBILEPROXY_JSPHON_DIR',            "$dir/lib/Jsphon");

/* The path of spyc library */
define('MOBILEPROXY_SPYC_DIR',              "$dir/lib/spyc");

/* The path of MobilePictogramConverter library */
define('MOBILEPROXY_MPC_DIR',               "$dir/lib/MobilePictogramConverter");

/* The HTTP URL of the directory which contains substitute Emoji images of MobilePictogramConverter */
define('MOBILEPROXY_MPC_IMAGEPATH',         "$scheme://$_SERVER[HTTP_HOST]$path/img/");

define('MOBILEPROXY_MPC_TAGREGEXP',         '|<img\ssrc="' . preg_quote(MOBILEPROXY_MPC_IMAGEPATH) . '[^>]*?>|');
define('MOBILEPROXY_EMOJI_REPLACE',         '〓');
define('MOBILEPROXY_MAX_HISTORIES',         100);
